package cn.fz.ssedemo.service;

import cn.fz.ssedemo.domain.properties.PubSubProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
@RequiredArgsConstructor
public class PublisherMessageService {
    private final RedisTemplate redisTemplate;
    private final PubSubProperties pubSubProperties;

    public void publish(Map<String,Object> map) {
        redisTemplate.convertAndSend(pubSubProperties.getTopic(), map);
    }
}
